﻿@model Nop.Web.Models.PrivateMessages.SendPrivateMessageModel
@using Nop.Web;
@using Nop.Web.Extensions;
@{    
    Layout = "~/Views/Shared/_ColumnsOne.cshtml";

    Html.AddTitleParts(T("PageTitle.SendPM").Text);
}
@using (Html.BeginForm())
{
    <div class="privatemessagesend">
        <div class="title">
            @T("PrivateMessages.Send.PostMessage")
        </div>
        <div class="wrapper">
            <div class="message-error">
                @Html.ValidationSummary(true)
            </div>
            @Html.HiddenFor(model => model.ToCustomerId)
            @Html.HiddenFor(model => model.ReplyToMessageId)
            <div class="clear">
            </div>
            <table class="postmessage">
                <tr>
                    <td class="fieldname">
                        @T("PrivateMessages.Send.To")
                    </td>
                    <td>
                        @if (Model.AllowViewingToProfile)
                           {
                                <a href="@Url.RouteUrl("CustomerProfile", new { id = Model.ToCustomerId })">@(Model.CustomerToName)</a>
                           }
                           else
                           {
                               @Model.CustomerToName
                           }
                    </td>
                </tr>
                <tr>
                    <td class="fieldname">
                        @T("PrivateMessages.Send.Subject")
                    </td>
                    <td>
                        @Html.TextBoxFor(model => model.Subject, new { @class = "pmtitletext" })
                        @Html.ValidationMessageFor(model => model.Subject)
                    </td>
                </tr>
                <tr>
                    <td class="fieldname">
                        @T("PrivateMessages.Send.Message")
                    </td>
                    <td>
                        @Html.BBCodeEditor("Message")
                        @Html.TextAreaFor(model => model.Message, new { @class = "bbeditortext", TextMode = "MultiLine" })
                        @Html.ValidationMessageFor(model => model.Message)
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="options">
                        <input type="submit" value="@T("PrivateMessages.Send.SendButton")" class="submitpmbutton"/>
                        <input type="button" class="cancelpmbutton" value="@T("PrivateMessages.Send.CancelButton")" 
                        onclick="setLocation('@Url.RouteUrl("PrivateMessages")')" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
}